home *** CD-ROM | disk | FTP | other *** search
- package
- {
- import flash.accessibility.*;
- import flash.debugger.*;
- import flash.display.*;
- import flash.errors.*;
- import flash.events.*;
- import flash.external.*;
- import flash.filters.*;
- import flash.geom.*;
- import flash.media.*;
- import flash.net.*;
- import flash.printing.*;
- import flash.profiler.*;
- import flash.system.*;
- import flash.text.*;
- import flash.ui.*;
- import flash.utils.*;
- import flash.xml.*;
- import jadeware.*;
- import mx.binding.*;
- import mx.core.Application;
- import mx.core.UIComponent;
- import mx.core.UIComponentDescriptor;
- import mx.core.mx_internal;
- import mx.events.FlexEvent;
- import mx.styles.*;
-
- use namespace mx_internal;
-
- public class Grizzly extends Application
- {
-
- mx_internal static var _Grizzly_StylesInit_done:Boolean = false;
-
-
- private var _embed_css____embeddatas_gfx_bgmenu_png_790785447:Class;
-
- private var _embed_css____embeddatas_gfx_w2bg_png_22127145:Class;
-
- private var _documentDescriptor_:UIComponentDescriptor;
-
- private var _gui:UIComponent;
-
- public function Grizzly()
- {
- _documentDescriptor_ = new UIComponentDescriptor({
- "type":Application,
- "propertiesFactory":function():Object
- {
- return {
- "width":624,
- "height":480
- };
- }
- });
- _embed_css____embeddatas_gfx_bgmenu_png_790785447 = Grizzly__embed_css____embeddatas_gfx_bgmenu_png_790785447;
- _embed_css____embeddatas_gfx_w2bg_png_22127145 = Grizzly__embed_css____embeddatas_gfx_w2bg_png_22127145;
- super();
- mx_internal::_document = this;
- if(!this.styleDeclaration)
- {
- this.styleDeclaration = new CSSStyleDeclaration();
- }
- this.styleDeclaration.defaultFactory = function():void
- {
- this.backgroundColor = 0;
- this.backgroundAlpha = 0;
- };
- mx_internal::_Grizzly_StylesInit();
- this.layout = "absolute";
- this.width = 624;
- this.height = 480;
- this.clipContent = false;
- this.addEventListener("applicationComplete",___Grizzly_Application1_applicationComplete);
- }
-
- public function addChildGameAt(param1:*, param2:int) : void
- {
- if(param1 != null)
- {
- _gui.addChildAt(param1,param2);
- }
- }
-
- public function setMenu() : void
- {
- var _loc1_:ContextMenuItem = new ContextMenuItem("Powered by JadeGame.com");
- _loc1_.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,menuItemSelected);
- var _loc2_:ContextMenu = new ContextMenu();
- _loc2_.hideBuiltInItems();
- _loc2_.addEventListener(ContextMenuEvent.MENU_SELECT,menuSelectHandler);
- _loc2_.customItems.push(_loc1_);
- application.contextMenu = _loc2_;
- }
-
- public function BringToFront(param1:*) : void
- {
- _gui.setChildIndex(param1,_gui.numChildren - 1);
- }
-
- public function ___Grizzly_Application1_applicationComplete(param1:FlexEvent) : void
- {
- AppMain();
- }
-
- public function getGameURL() : String
- {
- var _loc1_:String = String(Application.application.url);
- var _loc2_:Array = _loc1_.split("://");
- var _loc3_:Array = _loc2_[1].split("/");
- return String(_loc3_[0]);
- }
-
- public function setSitelock() : Boolean
- {
- var _loc1_:String = getGameURL();
- if(_loc1_ == null || _loc1_ == "")
- {
- return false;
- }
- if(_loc1_ != "jadegame.com" && _loc1_ != "www.jadegame.com" && _loc1_ != "flashgamelicense.com" && _loc1_ != "www.flashgamelicense.com")
- {
- Application.application.alpha = 0;
- return true;
- }
- return false;
- }
-
- public function removeChildGame(param1:*) : void
- {
- if(param1 != null)
- {
- _gui.removeChild(param1);
- }
- }
-
- private function menuItemSelected(param1:ContextMenuEvent) : void
- {
- navigateToURL(new URLRequest("http://www.jadegame.com"),"_blank");
- }
-
- private function menuSelectHandler(param1:ContextMenuEvent) : void
- {
- }
-
- override public function initialize() : void
- {
- mx_internal::setDocumentDescriptor(_documentDescriptor_);
- super.initialize();
- }
-
- public function addChildGame(param1:*) : void
- {
- if(param1 != null)
- {
- _gui.addChild(param1);
- }
- }
-
- private function AppMain() : void
- {
- _gui = new UIComponent();
- _gui.setStyle("backgroundColor","#000000");
- _gui.setStyle("backgroundAlpha",0);
- this.addChild(_gui);
- setMenu();
- jadeAPI.Initialize();
- jadeAPI.setHit();
- new LogicManager().InitPres();
- }
-
- public function get gui() : UIComponent
- {
- return _gui;
- }
-
- mx_internal function _Grizzly_StylesInit() : void
- {
- var style:CSSStyleDeclaration = null;
- var effects:Array = null;
- if(mx_internal::_Grizzly_StylesInit_done)
- {
- return;
- }
- mx_internal::_Grizzly_StylesInit_done = true;
- style = StyleManager.getStyleDeclaration("Canvas");
- if(!style)
- {
- style = new CSSStyleDeclaration();
- StyleManager.setStyleDeclaration("Canvas",style,false);
- }
- if(style.factory == null)
- {
- style.factory = function():void
- {
- this.color = 0;
- this.fontWeight = "bold";
- this.backgroundImage = _embed_css____embeddatas_gfx_w2bg_png_22127145;
- this.backgroundSize = "100%";
- };
- }
- style = StyleManager.getStyleDeclaration(".TextMenu");
- if(!style)
- {
- style = new CSSStyleDeclaration();
- StyleManager.setStyleDeclaration(".TextMenu",style,false);
- }
- if(style.factory == null)
- {
- style.factory = function():void
- {
- this.color = 16777215;
- };
- }
- style = StyleManager.getStyleDeclaration(".PresCanvas");
- if(!style)
- {
- style = new CSSStyleDeclaration();
- StyleManager.setStyleDeclaration(".PresCanvas",style,false);
- }
- if(style.factory == null)
- {
- style.factory = function():void
- {
- this.color = 0;
- this.fontWeight = "bold";
- this.backgroundImage = _embed_css____embeddatas_gfx_bgmenu_png_790785447;
- this.backgroundSize = "100%";
- };
- }
- style = StyleManager.getStyleDeclaration("Alert");
- if(!style)
- {
- style = new CSSStyleDeclaration();
- StyleManager.setStyleDeclaration("Alert",style,false);
- }
- if(style.factory == null)
- {
- style.factory = function():void
- {
- this.borderColor = 5861536;
- this.footerColors = [10335961,16777215];
- this.titleStyleName = "ΓÇ£alertTitleΓÇ¥";
- this.color = 995703;
- this.cornerRadius = 6;
- this.dropShadowEnabled = true;
- this.headerColors = [9479377,5861536];
- this.headerHeight = 19;
- this.dropShadowColor = 13753847;
- this.borderThickness = 1;
- this.borderStyle = "solid";
- this.backgroundColor = 16777215;
- };
- }
- style = StyleManager.getStyleDeclaration("Application");
- if(!style)
- {
- style = new CSSStyleDeclaration();
- StyleManager.setStyleDeclaration("Application",style,false);
- }
- style = StyleManager.getStyleDeclaration(".MenuCanvas");
- if(!style)
- {
- style = new CSSStyleDeclaration();
- StyleManager.setStyleDeclaration(".MenuCanvas",style,false);
- }
- if(style.factory == null)
- {
- style.factory = function():void
- {
- this.color = 0;
- this.fontWeight = "bold";
- this.backgroundImage = _embed_css____embeddatas_gfx_bgmenu_png_790785447;
- this.backgroundSize = "100%";
- };
- }
- style = StyleManager.getStyleDeclaration(".alertTitle");
- if(!style)
- {
- style = new CSSStyleDeclaration();
- StyleManager.setStyleDeclaration(".alertTitle",style,false);
- }
- if(style.factory == null)
- {
- style.factory = function():void
- {
- this.textAlign = "left";
- this.color = 16777215;
- this.fontWeight = "bold";
- this.fontSize = 10;
- this.fontFamily = "Verdana";
- };
- }
- StyleManager.mx_internal::initProtoChainRoots();
- }
-
- public function numChildrenGame() : int
- {
- if(_gui == null)
- {
- return 0;
- }
- return _gui.numChildren;
- }
- }
- }
-